package com.dayaokeji.rhythmschoolstudent.client.mine.bulletin;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;


import com.dayaokeji.rhythmschoolstudent.R;
import com.dayaokeji.rhythmschoolstudent.client.common.base.common.BaseActivity;
import com.dayaokeji.rhythmschoolstudent.client.main.MainActivity;

import butterknife.BindView;

/**
 * 通知
 */
public class BulletinActivity extends BaseActivity {

    @BindView(R.id.toolbar)
    Toolbar toolbar;


    public static void navigation(Context context) {
        Intent intent = new Intent(context, BulletinActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bulletin);
        setSupportActionBar(toolbar);
        setNavgationListener();
        init();
    }

    private void init() {
        getSupportFragmentManager().beginTransaction().replace(R.id.content,BulletinListFragment.newInstance()).commit();
    }

    private void setNavgationListener() {
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
    }

    @Override
    public void onBackPressed() {
        startActivity(new Intent(this, MainActivity.class));
        super.onBackPressed();
    }

}
